﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Diagnostics;

public partial class Test_testurl : System.Web.UI.Page
{
    private void Page_Load(object sender, System.EventArgs e)
    {
        string aburl = System.Web.HttpContext.Current.Request.ApplicationPath;
        if (!aburl.EndsWith("/"))
            aburl += "/";
        aburl = System.Web.HttpContext.Current.Request.Url.ToString().Replace(System.Web.HttpContext.Current.Request.Url.PathAndQuery, "") + aburl;
        if (System.Web.HttpContext.Current.Request.IsLocal)
            aburl = "http://localhost/" + aburl;
        Response.Write(aburl);
        Response.Write("<br />");
        Response.Write(System.Web.HttpContext.Current.Request.IsLocal);
        Response.Write("<br />");
        Response.Write(aburl);
        Response.Write("<br />");
    }

}